import VueRouter from 'vue-router';


import MainPage from '../components/pages/MainPage.vue'
import PageDetail from '../components/pages/ArcticleDetail.vue'
import TimeLine from '../components/pages/TimeLinePage.vue'
import About from '../components/pages/About.vue'
import ArticleList from '../components/pages/ArticleList.vue';
import Admin from '../components/pages/admin/Admin.vue';

import NewArcticle from "../components/pages/admin/NewArcticle.vue"
import AdminArcticleList from '../components/pages/admin/AdminArcticleList.vue'
import TagManager from '../components/pages/admin/TagManager.vue'
export default new VueRouter({
    routes: [
        {
            path: "/",
            redirect: "/main"
        },
        {
            name: "main",
            path: "/main",
            component: MainPage,
            props: true,
            children: [
                {
                    name: "ArticleList",
                    path: "page",
                    component: ArticleList,
                    props: true
                },
                {
                    name: "ArticleListforTagPage",
                    path: "tag",
                    component: ArticleList,
                    props: true
                }
            ]
        },
        {
            name: "detail",
            path: "/detail",
            component: PageDetail,
            props: true
        },
        {
            name: "timeline",
            path: "/timeline",
            component: TimeLine
        },
        {
            name: "about",
            path: "/about",
            component: About
        },
        {
            name: "admin",
            path: "/admin",
            component: Admin,
            children: [
                {
                    name: "addArcticle",
                    path: "updateArcticle",
                    component: NewArcticle
                },
                {
                    name: "updateArcticle",
                    path: "updateArcticle",
                    component: NewArcticle
                },
                {
                    name: "adminArcticleList",
                    path: "adminArcticleList",
                    component: AdminArcticleList
                },
                {
                    name: "tagManager",
                    path: "tagManager",
                    component: TagManager
                }
            ],
      
        }
    ]
})